package model;

import java.util.List;

import com.myprofile.profile.MuseumItem;
import com.myprofile.profile.ProfileType;

import daiia.ProfileManager;

public class Inventory {
	
	private final String xmlfile = "src/data/items.xml";
	ProfileManager pm;
	ProfileType it;
	
	public Inventory(){
		pm = new ProfileManager();
		it = pm.loadProfile("src/data/items.xml");
	}

	public List<MuseumItem> getItems(){
		return  it.getVisitedItems().getVisitedItem();
	}
	public MuseumItem getItem(int i){
		return  it.getVisitedItems().getVisitedItem().get(i);
	}

	public void add(MuseumItem arg){
		it.getVisitedItems().getVisitedItem().add(arg);
		pm.dumpProfile(it, xmlfile);
	}
	public void remove(MuseumItem arg){
		it.getVisitedItems().getVisitedItem().remove(arg);
		pm.dumpProfile(it, xmlfile);
	}
	public void remove(int i){
		it.getVisitedItems().getVisitedItem().remove(i);
		pm.dumpProfile(it, xmlfile);
	}
}
